<?php

namespace app\controller;

use app\BaseController;
use think\facade\Log;
use  \xy_jx\Utils;

class Api extends BaseController
{

    public function index()
    {
        var_dump(Utils\Sundry::orderNo());
    }

    public function rmb()
    {

        var_dump(Utils\Rmb::rmb_capital(15554.4));

    }

    public function mis_user($interfaceId, $arg)
    {
        //$arg = json_encode($arg);
        $url = 'http://139.198.178.30:891' . "?interfaceId=$interfaceId&arg=$arg";
        $line = "";
        $file_handle = fopen($url, "r");
        if (empty($file_handle)) {
            die("输入错误，文件不存在");
        }
        while (!feof($file_handle)) {
            $line .= fgets($file_handle);
        }
        fclose($file_handle);
        return $line;
    }


    public function cs()
    {
        $data = $this->request->all();
        Log::write(json_encode($data), 'feiyu');
        \Api::success('feiyu');
        event('UserLogin', ['id'=>1,'uid'=>1]);
        exit();
       // echo time();
       // echo '<br>';
    //  echo        date('Ymd',102632474649);
      echo  base_convert(date('Ymd'),10,32);
//        $client=  $this->mis_user("server", '{\"bankCode\":\"123456"}');
//
////        $client = new \SoapClient("ws://139.198.178.30:891",
////            array('trace' => 1,)
////        );
//      var_dump( $client);
    }
}